<!DOCTYPE html>
<html lang="zh-cmn-Hans">
  <head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="../../static/mobile/default/css/layout.css?v=2"/>
    <link rel="icon" type="image/png" href="../../static/favicon.ico"/>
        <script src="../../static/js/jquery/jquery/2.1.4/jquery.min.js"></script>
    <script src="../../static/js/jquery/jquery.cookie.js"></script>
    <script src="../../static/mobile/default/js/page.js?v=1"></script>
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
    <title>我的供应商  - 达漂亮</title>
          
<link rel="stylesheet" href="../../static/mobile/default/css/picker.css"/>
<link rel="stylesheet" href="../../static/mobile/default/css/userData.css" />


</head>
<body 
personalData
>
  <div class="page ">
    		<div class="page-hd">
            <div class="header base-header bor-1px-b">
                <div class="header-left">
                    <a href="javascript:history.go(-1)" class="left-arrow"></a>
                </div>
                <div class="header-title">我的供应商</div>
                <div class="header-right">
                    <!-- <a href=""></a> -->
                </div>
            </div>
        </div>
      
      <div class="page-bd ">
      <form id="userform">
        <!-- 页面内容-->
        <div class="cells">
          <a class="top cell  noline">
            <div class="cell_bd">
            <span class="fs34 color_3 fw_b">供应商头像</span></div>
            <div class="cell_ft" style="width: 0.8rem;height: 0.533333rem;">
            <img src="../../static/mobile/default/images/defheadimg.jpg" alt="" class="userimg" style="position: absolute;">
             <!--<input type="file" class="uploadInput" style="width:100%;height:100%;opacity:0;">-->
            </div>
          </a>
          <div class="cell">
              <div class="cell_bd">
            <span class="fs28 color_9  ">昵称</span></div>
            <div class="cell_ft">
                <span class="fs28 color_3 fw_b nick_name"></span>
            </div>
          </div>
          <!-- <div class="cell">-->
          <!--    <div class="cell_bd">-->
          <!--  <span class="fs28 color_9">个性签名</span></div>-->
          <!--  <div class="cell_ft">-->
          <!--      <input type="text" value="" name="signature" class="fs28 color_3 fw_b inputbox" placeholder="请输入">-->
          <!--  </div>-->
          <!--</div>-->
          <div class="cell">
            <div class="cell_bd"><span class="fs28 color_9">ID</span></div>
            <div class="cell_ft">
                <p class="fs28 color_3 fw_b userId"></p>
            </div>
          </div>
          <!--<div class="cell">-->
          <!--    <div class="cell_bd">-->
          <!--  <span class="fs28  color_9">注册时间</span></div>-->
          <!--  <div class="cell_ft">-->
          <!--      <p class="fs28 color_3 fw_b register_time"></p>-->
          <!--  </div>-->
          <!--</div>-->
          <!--<div class="cell">-->
          <!--    <div class="cell_bd">-->
          <!--  <span class="fs28  color_9">生日</span></div>-->
          <!--  <div class="cell_ft">-->
          <!--      <input type="text" value="0000-00-00"  name="birthday"  readonly class="fs28 color_3 fw_b" id="nowValue" placeholder="请选择">-->
          <!--  </div>-->
          <!--</div>-->
        <!--  <a href="./address.html" class="cell twoBox cell_access">-->
        <!--      <div class="cell_bd">-->
        <!--      <span class="fs28 color_9">收货地址管理</span></div>-->
        <!--      <div class="cell_ft">-->
        <!--      </div>-->
        <!--  </a>-->
        <!--<a href="../../user/user/bindphone.html">-->
        <!--  <div class="cell">-->
        <!--      <div class="cell_bd">-->
        <!--    <span class="fs28 color_9">绑定手机号</span></div>-->
        <!--    <div class="cell_ft">-->
        <!--        <p class="fs28 color_3 fw_b  phone"></p>-->
        <!--    </div>-->
        <!--  </div>-->
        <!--  </a>-->
          <!--<div class="cell">
              <div class="cell_bd">
              <span class="fs28 color_9">是否公开手机号</span></div>
              <div class="cell_ft">
                  <input type="checkbox" name="show_mobile" value="1" id="male" class="chooseBtn" />
                  <label for="male" class="choose-label"></label>
              </div>
            </div>-->
            <!--         <a href="../logout.html"  class=" cell cell_access noline">-->
            <!--    <div class="cell_bd"><span class="fs28 color_3 fw_b">退出登录</span></div>-->
            <!--</a>-->
                  </div> 
         
        </form>
        
        <!--<div class="page-ft">-->
        <!--    <span class="fs32 color_w fw_b BGcolor_r postBtn">保存</span>-->
        <!--  </div>-->

</div>
     

  </div>

<script src="../../static/js/art-template.js"></script>
<script src="../../static/mobile/default/js/lib/fastclick.js"></script>
<script src="../../static/js/jquery/lazyload/jquery.lazyload.js"></script>
<script>
    $(function() {
        FastClick.attach(document.body);
		$("img.lazy").lazyload({effect:"fadeIn",event:"scroll",container:$(".page-bd")});
    });
</script>

<script src="../../static/mobile/default/js/datePicker.js"></script>
<script src="../../static/mobile/default/js/picker.min.js"></script>
 <script>
                        
                        getUserInfo()
                 
                    //获取用户信息
                    function getUserInfo() {
                        $.ajax({
                            url: 'https://mp.jianguoes.com/api/mp/getFUser',// 跳转到 action
                            data: {},
                            type: 'get',
                            headers:{ token: $.cookie('code')},
                            dataType: 'json',
                            success: function (res) {
                                console.log(res);
                                if (res.errno == 0) {
                                    $('.nick_name').text(res.data.nickname)
                                    $('.userId').text(5000000+ Number(res.data.userId))
                                    $('.register_time').text(res.data.register_time)
                                    $('.userimg').attr("src", res.data.avatar)
                                    $('.phone').text(data.data.mobile)
                                   
                                }

                            }, error: function () {

                            }
                        });
                    }
                </script>
    <script>
          share()
     function  share(){
    /***用户点击分享到微信圈后加载接口接口*******/
        var url=window.location.href;
        console.log("url:"+url);
            $.ajax({
		    url: "/api/mp/wxconfig",
		    type: "post",
		    data:{shareUrl:url},
		    headers:{ token: $.cookie('code')},
		    dataType: "json",
		    success: function(data){
		         configData = {
                    debug : false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                    appId: data.data.appid, // 必填，公众号的唯一标识
                    timestamp: data.data.timestamp, // 必填，生成签名的时间戳
                    nonceStr: data.data.nonceStr, // 必填，生成签名的随机串
                    signature: data.data.signature,// 必填，签名，见附录1
                    jsApiList : ['hideOptionMenu']
                    // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
               };
               
               //step2:注入配置信息
               wx.config(configData);
               //step3:通过ready接口处理成功验证
               wx.ready(function () {
                   // config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，config是一个客户端的异步操作，所以如果需要在页面加载时就调用相关接口，则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口，则可以直接调用，不需要放在ready函数中。
//                 alert("执行ready方法");
//                 wx.checkJsApi({
//                      jsApiList: ['chooseImage'] // 需要检测的JS接口列表，所有JS接口列表见附录2,
//                      success: function(res) {
//                      // 以键值对的形式返回，可用的api值true，不可用为false
//                      // 如：{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
//                      }
//                 });
                   //接口1:获取网络类型
                    wx.getNetworkType({
                        success: function (res) {
                          oldNet = res.networkType; // 返回网络类型2g，3g，4g，wifi
//                        alert("网络类型"+ oldNet);
                        }
                     });
                   //禁用右上角菜单按钮
                   wx.hideOptionMenu();
		    })
		    },
		    error: function() {
// 			    _alert('ajax request failed!!!!');
			    return;
		    } 
        })

	    
	    
	    }
    
      $(function(){
        $('#nowValue').on('click',function(){
          demoClick()
        })
        $('.inputbox').on('click',function(){
          $(this).val('')
        })
        $('.picker-mask').on('click',function(){
          $('.picker').hide();
        })
      })
    // 日期选择器
    function demoClick() {
      var nowValue = document.getElementById('nowValue');
        new DatePicker({
            "type": "3",//0年, 1年月, 2月日, 3年月日
            "title": '请选择日期',//标题(可选)
            "maxYear": "",//最大年份（可选）
            "minYear": "",//最小年份（可选）
            "separator": ".",//分割符(可选)
            "defaultValue": nowValue.value,//默认值（可选）
            "callBack": function (val) {
                //回调函数（val为选中的日期）
                nowValue.value = val;
            }
        });
    }
      //性别选择
      var obj=document.getElementById('sex')
      var data1 = [
          {
            text:'男',
            value: '1',
          }, {
            text:'女',
            value: '2',
          }
      ];
      //初始化picker
      var picker = new Picker({
          data: [data1],
          selectedIndex: [0],
          title: '请选择性别'
      });
      //选择后的内容赋值
      picker.on('picker.select', function (selectedVal, selectedIndex) {
        obj.value = data1[selectedIndex].text;
      })
      //点击弹出选项框
      obj.addEventListener('click', function () {
          picker.show();
      });

var fd = new FormData();

$('.postBtn').click(function(){
	var data = $('#userform').toJson();
	$.each(data,function(i,v){
		fd.append(i, v);	
	})
	
	$.ajax({
		  url: '/member/api.users/editinfo.html',
		  type: 'post',
		  processData: false,
		  contentType: false,
		  data: fd,
		  success: function (res) {

		      if (res.code == 0){
				  _alert(res.errmsg);
				  return false;	
			  }
              window.location.href = '/member/center/index.html';
		  }
	})
})
</script>
<script src="../../static/mobile/default/js/uploadsimage.js?v=1"></script>
    <script>
    //处理点击改变的调用函数-做IOS兼容
    $(_listenSelector).click(function(){
            var that = $(this);
            _uplocalfunction=function(base64Img){   
            fd.append("imgfile", base64Img);
            $('.userimg').attr('src',base64Img);
          }
            //console.log(typeof(_uplocalfunction))
    })
</script>

  <div class="alertBox">
      <div class="alertBG"></div>
      <div class="alert">
          <div class="text fs30 color_3 bor_b">

          </div>
          <!-- 单按钮 -->
          <div class="button fs32 fw_b color_r">
              知道了
          </div>
          <!-- 双按钮 -->
          <div class="buttonBox fs32 fw_b">
              <span class="color_9 bor_r cancel">取消</span>
              <span class="color_r confirm">确定</span>
          </div>
      </div>
  </div>
  <script type="text/javascript">
      var is_xcx = 0;
      $(document).on('click', 'a', function () {
          var href = $(this).attr('href');
          if (href.indexOf('/pages') != -1) {
              if (is_xcx == 1) {
                  wx.miniProgram.navigateTo({
                      url: href
                  })
                  return false;
              } else {
                  return false;
              }
          }
      })
  </script>
    </body>
</html>